import request from "@/utils/request"

// 获取用水类别
export const getWaterTypeApi = async (params) => {
    return request.get('/extended_type/', {
        params: {
            id: 0,
            ...params
        }
    }).then(res => {
        let data = res.data
        data = data.filter(item => item.type === 1)
        return {
            ...res,
            data
        }
    })
}

//添加用水类别
export const addWaterTypeApi = async (data) => {
    return request.post('/extended_type/', {
        ...data,
        type: 1
    })
}

//删除类别
export const deleteTypeApi = async (data) => {
    return request.delete('/extended_type/', {
        data
    })
}

